package com.supermap.business.cloud.cust.user;

import com.alibaba.dubbo.config.annotation.Reference;
import com.supermap.dataservice.util.JSONUtil;
import com.supermap.dubbo.api.cloud.cust.user.SysUserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author aqua
 * @desc
 * @date 2019年03月04 15:48
 * @email 1301584033@qq.com
 */
@Controller
@RequestMapping("/cloud/cust/user")
public class SysUserController {
    @Reference(timeout = 100000)
    private SysUserService sysUserService;


    //用户
    @GetMapping("/getUserTreeAreaRole")
    @ResponseBody
    public JSONUtil getUserTreeAreaRole(String areaCode, Integer areaRoleId,String loginName,Integer limit){
        return  sysUserService.getUserTreeAreaRole(areaCode,areaRoleId,loginName,limit);
    }
    //用户菜单
    @GetMapping("/getUserMenu")
    @ResponseBody
    public JSONUtil getUserMenu(String userId){
        return  sysUserService.getUserMenu(userId);
    }

    //用户菜单分配
    @PutMapping("/putUserMenu")
    @ResponseBody
    public JSONUtil putUserMenu(Integer userId,String menuIds){
        return  sysUserService.putUserMenu(userId,menuIds);
    }
}
